package com.qijian.quality.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.quality.domain.InspectionResultRecord;
import com.qijian.quality.domain.query.InspectionResultRecordQuery;
import com.qijian.quality.domain.vo.InspectionResultRecordDetailVo;
import com.qijian.quality.domain.vo.InspectionResultRecordVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 质检结果记录Mapper接口
 *
 * @author qijian
 * @date 2025-03-28
 */
public interface InspectionResultRecordMapper extends BaseMapper<InspectionResultRecord> {

    @Select("select count(0) from inspection_result_record WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    Page<InspectionResultRecordVo> pageVo(Page<InspectionResultRecord> page, @Param(Constants.WRAPPER) QueryWrapper<InspectionResultRecordQuery> query);

    List<InspectionResultRecordDetailVo> getInspectionData(Long id);
}
